public class Person {
    String name;
    String gender;
    int age;

    public Person(String name,String gender,int age){
        this.name=name;
        this.gender=gender;
        this.age=age;

    }
    public String toString(){


        return "["+name+","+gender+","+age+"]";
    }

    public static void main(String[] args) {
        Person person=new Person("Jim","男",18);

        //重写toString方法了

        System.out.println(person);

        //此时打印的是类似于地址的东西

        //如果要默认打印对象中的属性该如何处理呢？
        //答案：重写toString方法重写即可
        //


    }



}
